function [cellMat,numMat]=struc2cellprint(struct,structNames,Ndecimal) 
% =========================================================================
% [cellMat,numMat]=struc2cellprint(struct,structNames,Ndecimal) 
%
% Description 
%
% Convert the structure STRUCT into a 
% 1) Numeric matrix NUMMAT 
% 2) Cell array CELLMAT
%
% The cell array has the (optional) names STRUCTNAMES as
% the first column. If no name is provided, fieldnames will be used. 
% The default number of decimal places in converting from numeric to cell is 
% NDECIMAL, is 3. 
%
% Alejandro Justiniano September 4th 2012 
% =========================================================================
if nargin < 2 || isempty(structNames)==true
    structNames=fieldnames(struct);
end
numMat=cell2mat(struct2cell(struct)); 
if nargin < 3 || isempty(Ndecimal)==true
    Ndecimal=3;
end
cellMat=num2cprec(numMat,Ndecimal);
%if nargin > 1 && isempty(structNames)==false
cellMat=[structNames cellMat];
%end
end